<template>
  <div>
    <el-table :data="userArr">
      <el-table-column align="center" type="index" label="商品编号" width="100px"/>
      <el-table-column align="center" prop="username" label="用户名" />
      <el-table-column align="center" prop="nickName" label="昵称"/>
      <el-table-column align="center"  label="头像" >
        <template slot-scope="scope">
          <img :src="scope.row.imgUrl" width="80px"/>
        </template>
      </el-table-column>
      <el-table-column align="center"  label="管理员" >
        <template slot-scope="scope">
          <el-switch v-model="scope.row.isAdmin"></el-switch>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="createTime" label="发布时间" />

      <el-table-column label="操作">
        <template slot-scope="scope" >
          <el-button type="danger" size="small" @click="handleClick(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userArr: [
        {
          id: 12,
          nickName: '汤姆',
          username: 'tom',
          isAdmin: true,
          imgUrl: '/imgs/head.jpg',
          createTime: '2024/2/23 00:01:01'
        },
        {
          id: 13,
          nickName: '刘德华',
          username: 'liudehua',
           isAdmin: true,
          imgUrl: '/imgs/head.jpg',
        createTime: '2024/2/23 00:01:01'
        },
        {
          id: 14,
          nickName: '程乐乐',
          username: 'chenglele',
          isAdmin: true,
          imgUrl: '/imgs/head.jpg',
          createTime: '2024/2/23 00:01:01'
        }

      ]
    }
  }
}
</script>

<style scoped>

</style>
